<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>后台管理</title>
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/layui/css/layui.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/admin.css" />
<style>
.layui-form-label{ width:100px;}
.layui-input-block{ margin-left:130px;}
</style>
</head>
<body>
<div class="wrap-container">
  <form class="layui-form edit-form" method="post" action="{:url()}" style="width: 90%;padding-top: 20px;">
  	{present name="info.id"}
    <input type="hidden" name="id" value="{$info.id|default=''}" />
    {/present}
    <input type="hidden" name="group_id" value="2" />
    
    {if condition="!isset($info)"}
    <div class="layui-form-item">
      <label class="layui-form-label">选择下载页模板：</label>
      <div class="layui-input-block">
        <select name="appid" lay-verify="required">
          <option value=""></option> 
          {volist name='_app' id='vo'}
          <option value="{$vo.id}">{$vo.title}</option>
          {/volist}
          
        </select>
      </div>
    </div>
    {/if}
    
    <div class="layui-form-item">
      <label class="layui-form-label">代理账号：</label>
      <div class="layui-input-block">
        <input type="text" name="username" value="{$info.username|default=''}" required lay-verify="required" placeholder="请输入代理账号" autocomplete="off" class="layui-input">
      </div>
    </div> 

    <div class="layui-form-item">
      <label class="layui-form-label">代理密码：</label>
      <div class="layui-input-block">
        <input type="text" name="password" value="" {if condition="!isset($info)"}required lay-verify="required"{/if} placeholder="请输入代理密码" autocomplete="off" class="layui-input">
      </div>
    </div>
    
    <div class="layui-form-item">
      <label class="layui-form-label">代理昵称：</label>
      <div class="layui-input-block">
        <input type="text" name="name" value="{$info.name|default=''}" required lay-verify="required" placeholder="请输入代理昵称" autocomplete="off" class="layui-input">
      </div>
    </div>
    
    <div class="layui-form-item">
      <label class="layui-form-label">代理电话：</label>
      <div class="layui-input-block">
        <input type="text" name="mobile" value="{$info.mobile|default=''}" placeholder="请输入代理电话" autocomplete="off" class="layui-input">
      </div>
    </div> 
	
	<div class="layui-form-item">
      <label class="layui-form-label">渠道号：</label>
      <div class="layui-input-block">
        <input type="text" name="cid" value="{$info.cid|default=''}" placeholder="请输入渠道号" autocomplete="off" class="layui-input">
      </div>
    </div> 
	
	<div class="layui-form-item">
      <label class="layui-form-label">渠道包地址：</label>
      <div class="layui-input-block">
        <input type="text" name="apk_url" value="{$info.apk_url|default=''}" placeholder="请输入渠道包地址" autocomplete="off" class="layui-input">
      </div>
    </div> 
   
   
   	<div class="layui-form-item">
      <label class="layui-form-label">提成比例：</label>
      <div class="layui-input-inline">
        <input type="number" name="my_point" value="{$info.my_point|default=''}" required lay-verify="required" placeholder="请输入提成比例" autocomplete="off" class="layui-input">
      </div>
      <div class="layui-form-mid layui-word-aux" style="color:#f00">% 可设范围：0 - {$vars.one_point}</div>
    </div> 
    
    <div class="layui-form-item">
      <label class="layui-form-label">状态：</label>
      <div class="layui-input-block">
        <input type="radio" name="status" value="1" title="正常" checked>
        <input type="radio" name="status" value="0" title="禁用">
      </div>
    </div>
    
    <div class="layui-form-item">
      <div class="layui-input-block">
        <button class="layui-btn layui-btn-normal ajax-post-btn" lay-submit lay-filter="formDemo">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
      </div>
    </div>
  </form>
</div>
<script src="__STATIC__/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> 
<script src="__STATIC__/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="__STATIC__/js/common.js" type="text/javascript" charset="utf-8"></script> 
<script>
			//Demo
			layui.use(['form','jquery'], function() {
				var form = layui.form();
				var $ = layui.jquery;
				form.render();
				//监听提交
				form.on('submit(formDemo)', function(data) {
					//layer.msg(JSON.stringify(data.field));
					ajax_post('edit-form',true,'iframe127','');
					return false;
				});
				
			});

		
{present name="info.id"}
$(function(){
	setValue("group_id", {$info.group_id|default=0});	
	setValue("status", {$info.status|default=1});
});
{/present}
</script>


</body>
</html>